use "Table3_data.dta" 

***********************Regression for Table 3***********************************
*************Continuous Impact of Farmland Conservation on Total Grassland******
******************Data from USGS************************************************
ssc install outreg2

xtreg log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn i.state_fips#c.year, fe 
outreg2 using DID1.tex,replace ctitle(Full) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) addtext(County FE, Yes, State*Year Trend, Yes ) title("Table 1: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtreg log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn i.state_fips#c.year if year<1950, fe 
outreg2 using DID1.tex,append ctitle($<$ 1950) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) addtext(County FE, Yes, State*Year Trend, Yes ) title("Table 1: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtreg log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn i.state_fips#c.year if year<1960, fe 
outreg2 using DID1.tex,append ctitle($<$ 1960) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) addtext(County FE, Yes, State*Year Trend, Yes ) title("Table 1: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtreg log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn i.state_fips#c.year if year<1970, fe 
outreg2 using DID1.tex,append ctitle($<$ 1970) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) addtext(County FE, Yes, State*Year Trend, Yes ) title("Table 1: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})
 

xtreg log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn i.state_fips#c.year if year<1980, fe 
outreg2 using DID1.tex,append ctitle($<$ 1980) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) addtext(County FE, Yes, State*Year Trend, Yes ) title("Table 1: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})

***************************Arellano-Bond Dynamic Panel Model****************************************
***********************Regression for Table 4***********************************
*************Continuous Impact of Farmland Conservation on Total Grassland******
******************Data from USGS************************************************


xtabond log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn
outreg2 using DID2.tex,replace ctitle(Full) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) title("Table 2: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtabond log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn if year<1950
outreg2 using DID2.tex,append ctitle($<$ 1950) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) title("Table 2: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtabond log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn if year<1960 
outreg2 using DID2.tex,append ctitle($<$ 1960) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) title("Table 2: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})


xtabond log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn if year<1970 
outreg2 using DID2.tex,append ctitle($<$ 1970) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) title("Table 2: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})
 

xtabond log_grass_prop log_budgetmwheat log_budgetmcotton log_budgetmcorn if year<1980 
outreg2 using DID2.tex,append ctitle($<$ 1980) label keep(log_budgetmwheat log_budgetmcotton log_budgetmcorn) title("Table 2: Continuous Impact of Farmland Conservation on Total Grassland"\label{tab1})